<?php

class DefaultController extends MyUserController
{
	public $modelName = 'Faq';
	
	public function actionIndex()
	{
		$model = new Faq();
		
		$criteria=new CDbCriteria;
		$criteria->order = 'sorter';
		$criteria->condition = 'active=1';
		$questions = Faq::model()->findAll($criteria);

		$this->render('view',array(
			'model'=>$this->loadModel($model->getMinId()), 'questions'=>$questions
		));
	}
	
	public function actionView($id)
	{
		$criteria=new CDbCriteria;
		$criteria->order = 'sorter';
		$criteria->condition = 'active=1';
		$questions = Faq::model()->findAll($criteria);

		$this->render('view',array(
			'model'=>$this->loadModel($id), 'questions'=>$questions
		));
	}
}